package com.example.demo.Service;

import com.example.demo.Dao.ArticleMapper;
import com.example.demo.Model.ArtInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleService {
    @Autowired
    private ArticleMapper articleMapper;

    public List<ArtInfo> getArtById (int uid) {
        return articleMapper.getArtById(uid);
    }

    public int del(Integer aid,int uid) {
        return articleMapper.del(aid,uid);
    }

    public int add(ArtInfo artInfo) {
        return articleMapper.add(artInfo);
    }

    public ArtInfo getArticleByAid(int aid,int uid) {
        return articleMapper.getArticleByAid(aid,uid);
    }

    public int doupdate(ArtInfo artInfo) {
        return articleMapper.doupdate(artInfo);
    }

    public ArtInfo getArticleById(int uid) {
        return articleMapper.getArticleById(uid);
    }

    public int GetUserArtCount(int uid) {
        return articleMapper.GetUserArtCount(uid);
    }

    public int incrementRCount(int aid) {
        return articleMapper.incrementRCount(aid);
    }

    public List<ArtInfo> getListByPage(int psize,int offset){
        return articleMapper.getListByPage(psize,offset);
    }

    public int getCount() {
        return articleMapper.getCount();
    }
}
